<template>
  <div class="head-box" @click="handHead()">
    <div class="head-l">
      <img
        class="head-img"
        :src="$filters.prefix(details.picture)"
        fit="cover"
      />
      <div class="name-box">
        <div class="name">{{ details.author }}</div>
        <div class="post">{{ details.position }}</div>
      </div>
    </div>
    <img class="jiantou" src="@/assets/imgs/jiantou.png" alt="" />
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
  name: "headMsg",
  props: {
    details: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  setup(props) {
    const handHead = () => {
      if (props.details.recordId) {
        window.open(
          `http://h5.cbda1984.com/personDetail?recordId=${props.details.recordId}`
        );
      }
    };
    return { handHead };
  },
});
</script>
<style lang="scss" scoped>
.head-box {
  padding: 15px;
  box-sizing: border-box;
  border-radius: 6px;
  background-color: #f7f7f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  .jiantou {
    width: 8px;
    height: 8px;
  }
  .head-l {
    display: flex;
    text-align: left;
    .head-img {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      margin-right: 8px;
    }
    .name-box {
      .name {
        font-weight: bold;
        color: #312d2d;
        font-size: 15px;
        margin-bottom: 5px;
      }
      .post {
        color: #808080;
        font-size: 13px;
      }
    }
  }
}
</style>
